<template>
	<!-- 板块标题组件 -->
	<!-- 可传递参数
	bacg 背景颜色 默认白色
	titleColor 标题颜色 默认黑色
	isShowMore 是否展示查看全部
	isShowBtn 是否展示按钮 -->
	<!-- 标题 -->
	<view class="project_title" :style="{'background':bacg}">
		<!-- 标题 -->
		<view class="project_title_content" :style="{'color':titleColor}">
			{{ titleName }}
		</view>
		<!-- 标题链接 更多 -->
		<view class="project_title_more" v-show="isShowMore">
			<text>查看全部</text>
			<u-icon name="arrow-right" size="12"></u-icon>
		</view>
		<!-- button -->
		<view class="" v-show="isShowBtn">
			<u-button text="创建任务" color="var(--echo-main-color)" size="small"
				icon="plus" @tap="open" :plain="true"></u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			};
		},
		props: {
			titleName: {
				type: String,
			},
			// 是否展示更多
			isShowMore: {
				type: Boolean,
				default: false
			},
			// 是否展示按钮
			isShowBtn: {
				type: Boolean,
				default: false
			},
			// 组件总背景颜色
			bacg: {
				type: String,
				default: '#fff',
			},
			// 标题颜色
			titleColor: {
				type: String,
				default: '#333',
			}

		},
		methods: {
			open() {
				this.$emit("open")
			}
		}
	}
</script>

<style lang="scss">
	/* 每个板块项目的大标题 */
	.project_title {
		display: flex;
		justify-content: space-between;
		align-items: center;
		background-color: #FFF;
		padding: 30rpx;

		&_content {
			color: #333;
			font-size: $echo-font-size-title;
			display: flex;

			&:before {
				display: block;
				content: '';
				width: 10rpx;
				height: 40rpx;
				background: $echo-main-color;
				border-radius: 4rpx;
				margin-right: 20rpx;
			}
		}

		&_more {
			display: flex;
			color: #777;
			align-items: baseline;
		}
	}
</style>
